<%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*" %>
response.setHeader("Pragma","No-cache"); 
response.setHeader("Cache-Control","no-cache"); 
response.setDateHeader("Expires", 0); 
<%

Random rr=new Random();
int rrr=rr.nextInt(8999)+1000;
Integer tem=new Integer(rrr);
String base=String.valueOf(tem);
BufferedImage img=new BufferedImage(60,20,BufferedImage.TYPE_INT_RGB);
Graphics g=img.getGraphics();
g.setColor(new Color(0xdcdcdc));
g.fillRect(0,0,60,20);
g.setColor(Color.black);
g.drawRect(0,0,59,19);
g.setColor(Color.red);

for(int ff=0;ff<4;ff++){
String tt=base.substring(ff,ff+1);
g.drawString(tt,5+ff*14,14);
}

session.setAttribute("yzm_value",base);
for(int a=0;a<50;a++)
  g.drawOval(rr.nextInt(60),rr.nextInt(20),0,0);
ImageIO.write(img,"JPEG",response.getOutputStream());
response.flushBuffer();
out.clear();
out = pageContext.pushBody();
%>
